bug#69992: Minor improvement to image map transformation logic
authorDavid Ponce <da_vid@orange.fr>
Sat, 30 Mar 2024 12:59:41 +0000 (13:59 +0100)
committerEli Zaretskii <eliz@gnu.org>
Sat, 30 Mar 2024 13:35:11 +0000 (16:35 +0300)
commitcc212ea314d45c98761ae7f68600ad8bf799ea36
treedb4479c9e02708a62ca6ec786002a806e818a8af
parent87be53846bfbf5a6387cb5a40105bd0fc5b48b38
bug#69992: Minor improvement to image map transformation logic

* lisp/image.el (image--compute-rotation): New function.
(image--compute-map, image--compute-original-map): Use it.
Ensure all transformations are applied or undone according to what
Emacs does internally.  Call a transformation function only when
needed.  Fix doc string.
(image--scale-map, image--rotate-map): Assume effective scale
argument.
(image--rotate-coord): Improve doc string.
(image--flip-map): Remove no more used argument FLIP.

* test/lisp/image-tests.el (image-create-image-with-map): Use a
valid SVG image otherwise `image-size' will not return a valid
value and calculation of scale could fail.
(image-transform-map): Update according to changed signature of
`image--flip-map'.
lisp/image.el
test/lisp/image-tests.el